package com.luguokong.pet_rescue.mapper;

import com.luguokong.pet_rescue.pojo.Pet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PetMapper {
    public int insertPet(Pet pet);
    public int deletePetById(int pet_id);
    public int updatePetById(Pet pet);
    public Pet selectPetById(int pet_id);
    public List<Pet> selectPetAll();
    public List<Pet> selectPetAllByType(String pet_type);
    public List<Pet> selectPetAllBySpecies(String pet_species);
    public List<Pet> selectPetAllByIsAdopt();
    public List<Pet> selectPetAllByIsNotAdopt();
    public List<Pet> selectPetAllByRecentIsAdopt();
    public List<Pet> selectPetAllByIsAdoptByUserId(int user_id);

    @Select("select * from pets limit #{pageNum},#{pageSize}")
    public List<Pet> selectPetAllByPageNumByPageSize(int pageNum, int pageSize);

    @Select("select count(*) from pets")
    public int selectDataCount();
}
